﻿
/*----------------------------------------------------------------//
// 文件名：MoEquipMaintainLog.cs
// 文件功能描述：实体 MoEquipMaintainLog.
// 
// 创建标识：Template  ver 5.0.20090429 2009-11-20
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoEquipMaintainLog
using System;
using System.Data;
namespace EQT.Model
{
    /// <summary>
    /// 业务实体MoEquipMaintainLog
    /// </summary>
    public partial class MoEquipMaintainLog : ICloneable
    {
        #region 表EquipMaintainLog的字段
        private int equiMtnId;
        private string equipId;
        private string empId;
        private DateTime mtnDate;
        private string mtnInfo;
        #endregion

        #region 构造函数
        public MoEquipMaintainLog()
        {
            mtnDate = new DateTime(1900, 1, 1);

        }
        #endregion

        #region 拷贝构造函数

        public MoEquipMaintainLog(MoEquipMaintainLog item)
        {
            item.CopyTo(this);
        }
        #endregion

        #region 带参数构造函数
        public MoEquipMaintainLog(int equiMtnId, string equipId, string empId, DateTime mtnDate, string mtnInfo)
        {
            this.equiMtnId = equiMtnId;
            this.equipId = equipId;
            this.empId = empId;
            this.mtnDate = mtnDate;
            this.mtnInfo = mtnInfo;
        }
        #endregion

        #region 表EquipMaintainLog的字段属性
        /// <summary>
        /// EQUI_MTN_ID
        /// </summary>
        public int EquiMtnId
        {
            get { return equiMtnId; }
            set { equiMtnId = value; }
        }
        /// <summary>
        /// EQUIP_ID
        /// </summary>
        public string EquipId
        {
            get { return equipId; }
            set { equipId = value; }
        }
        /// <summary>
        ///人员序号 E0001,E0002
        /// </summary>
        public string EmpId
        {
            get { return empId; }
            set { empId = value; }
        }
        /// <summary>
        /// MTN_DATE
        /// </summary>
        public DateTime MtnDate
        {
            get { return mtnDate; }
            set { mtnDate = value; }
        }
        /// <summary>
        /// MTN_INFO
        /// </summary>
        public string MtnInfo
        {
            get { return mtnInfo; }
            set { mtnInfo = value; }
        }
        #endregion

        #region 辅助函数
        /// <summary>
        /// 拷贝函数
        /// </summary>
        public MoEquipMaintainLog CopyTo(MoEquipMaintainLog item)
        {
            item.equiMtnId = this.equiMtnId;
            item.equipId = this.equipId;
            item.empId = this.empId;
            item.mtnDate = this.mtnDate;
            item.mtnInfo = this.mtnInfo;
            return item;
        }
        /// <summary>
        /// 克隆函数
        /// </summary>		
        public object Clone()
        {
            MoEquipMaintainLog mo = new MoEquipMaintainLog();
            mo.EquiMtnId = this.EquiMtnId;
            mo.EquipId = this.EquipId;
            mo.EmpId = this.EmpId;
            mo.MtnDate = this.MtnDate;
            mo.MtnInfo = this.MtnInfo;
            return mo;
        }
        ///<summary>
        ///判断对象是否相等
        ///<summary>
        public override bool Equals(object obj)
        {
            if (object.ReferenceEquals(this, obj))
            {
                return true;
            }
            else
            {
                MoEquipMaintainLog NewEquipMaintainLog = obj as MoEquipMaintainLog;
                if (NewEquipMaintainLog == null)
                {
                    return false;
                }
                else
                {
                    if (NewEquipMaintainLog.EquiMtnId == this.EquiMtnId && NewEquipMaintainLog.EquipId == this.EquipId && NewEquipMaintainLog.EmpId == this.EmpId && NewEquipMaintainLog.MtnDate == this.MtnDate && NewEquipMaintainLog.MtnInfo == this.MtnInfo)
                    {
                        return true;
                    }
                }

            }
            return false;

        }
        ///TODO:you should modify GetHashCode by yourself.
        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override string ToString()
        {
            return String.Format(System.Globalization.CultureInfo.InvariantCulture, "EquiMtnId={0}/EquipId={1}/EmpId={2}/MtnDate={3}/MtnInfo={4}", equiMtnId, equipId, empId, mtnDate, mtnInfo);

        }
        #endregion


        #region DataTable Help Function
        ///<summary>
        ///DataRow转换成Model
        ///</summary>
        public void Row2Model(DataRow row)
        {
            if (row["Equi_Mtn_ID"] != null && row["Equi_Mtn_ID"] != DBNull.Value)
            {
                this.EquiMtnId = (int)row["Equi_Mtn_ID"];
            }
            else
            {
                this.EquiMtnId = 0;
            }
            if (row["Equip_ID"] != null && row["Equip_ID"] != DBNull.Value)
            {
                this.EquipId = (string)row["Equip_ID"];
            }
            else
            {
                this.EquipId = string.Empty;
            }
            if (row["Emp_ID"] != null && row["Emp_ID"] != DBNull.Value)
            {
                this.EmpId = (string)row["Emp_ID"];
            }
            else
            {
                this.EmpId = string.Empty;
            }
            if (row["Mtn_Date"] != null && row["Mtn_Date"] != DBNull.Value)
            {
                this.MtnDate = (DateTime)row["Mtn_Date"];
            }
            else
            {
                this.MtnDate = DateTime.MinValue;
            }
            if (row["Mtn_Info"] != null && row["Mtn_Info"] != DBNull.Value)
            {
                this.MtnInfo = (string)row["Mtn_Info"];
            }
            else
            {
                this.MtnInfo = string.Empty;
            }
        }

        ///<summary>
        ///Model转换成DataRow
        ///</summary>
        public void Model2Row(DataRow row)
        {
            row["Equi_Mtn_ID"] = this.EquiMtnId;
            row["Equip_ID"] = this.EquipId;
            row["Emp_ID"] = this.EmpId;
            row["Mtn_Date"] = this.MtnDate;
            row["Mtn_Info"] = this.MtnInfo;
        }
        #endregion
    }
}
#endregion
